```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RabbitMQ 延迟消息插件使用指南</title>
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Noto Sans SC', 'Noto Serif SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .code-block {
            background-color: #2d2d2d;
            border-radius: 8px;
            color: #f8f8f2;
        }
        .step-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .highlight-text {
            background: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
            background-repeat: no-repeat;
            background-size: 100% 0.4em;
            background-position: 0 88%;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col items-center text-center">
                <h1 class="text-4xl md:text-5xl font-bold mb-6">RabbitMQ <span class="highlight-text">延迟消息插件</span> 指南</h1>
                <p class="text-xl md:text-2xl max-w-3xl mb-8 opacity-90">高效实现消息延迟投递的专业解决方案</p>
                <div class="flex space-x-4">
                    <a href="#installation" class="bg-white text-indigo-700 hover:bg-gray-100 font-medium py-3 px-6 rounded-full transition duration-300 transform hover:scale-105">
                        <i class="fas fa-download mr-2"></i>安装指南
                    </a>
                    <a href="#implementation" class="bg-transparent border-2 border-white text-white hover:bg-white hover:text-indigo-700 font-medium py-3 px-6 rounded-full transition duration-300">
                        <i class="fas fa-code mr-2"></i>实现代码
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 py-12">
        <!-- Installation Section -->
        <section id="installation" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 p-3 rounded-full mr-4">
                    <i class="fas fa-download text-indigo-600 text-xl"></i>
                </div>
                <h2 class="text-3xl font-bold text-gray-800">安装步骤</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- Step 1 -->
                <div class="bg-white p-6 rounded-xl shadow-md transition duration-300 step-card">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 text-indigo-600 font-bold rounded-full w-8 h-8 flex items-center justify-center mr-3">1</div>
                        <h3 class="text-xl font-semibold text-gray-800">下载插件</h3>
                    </div>
                    <p class="text-gray-600 mb-4">根据您的RabbitMQ版本选择对应的插件</p>
                    <a href="https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases" class="text-indigo-600 hover:text-indigo-800 font-medium inline-flex items-center">
                        下载地址 <i class="fas fa-external-link-alt ml-2 text-sm"></i>
                    </a>
                    <div class="mt-4">
                        <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670050840320-6cae05e3-431b-4c85-83dd-d090ba509b2a.png" alt="插件下载示例" class="rounded-lg border border-gray-200">
                    </div>
                </div>
                
                <!-- Step 2 -->
                <div class="bg-white p-6 rounded-xl shadow-md transition duration-300 step-card">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 text-indigo-600 font-bold rounded-full w-8 h-8 flex items-center justify-center mr-3">2</div>
                        <h3 class="text-xl font-semibold text-gray-800">拷贝插件至容器</h3>
                    </div>
                    <div class="code-block p-4 mb-4">
                        <code class="text-sm">docker cp rabbitmq_delayed_message_exchange-3.8.17.8f537ac.ez rabbitmq:/plugins</code>
                    </div>
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670051009108-74010d4e-84aa-4858-8e4e-49437e7347a7.png" alt="插件拷贝示例" class="rounded-lg border border-gray-200">
                </div>
                
                <!-- Step 3 -->
                <div class="bg-white p-6 rounded-xl shadow-md transition duration-300 step-card">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 text-indigo-600 font-bold rounded-full w-8 h-8 flex items-center justify-center mr-3">3</div>
                        <h3 class="text-xl font-semibold text-gray-800">进入容器查看插件</h3>
                    </div>
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670051150014-5581d748-124a-4926-8a80-737746f03eac.png" alt="查看插件示例" class="rounded-lg border border-gray-200">
                </div>
                
                <!-- Step 4 & 5 -->
                <div class="bg-white p-6 rounded-xl shadow-md transition duration-300 step-card">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 text-indigo-600 font-bold rounded-full w-8 h-8 flex items-center justify-center mr-3">4</div>
                        <h3 class="text-xl font-semibold text-gray-800">安装插件并重启</h3>
                    </div>
                    <div class="code-block p-4 mb-4">
                        <code class="text-sm">rabbitmq-plugins enable rabbitmq_delayed_message_exchange</code>
                    </div>
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670051212002-bc145046-1d83-4969-9af7-4c0856237276.png" alt="安装插件示例" class="rounded-lg border border-gray-200 mb-4">
                    
                    <div class="flex items-start mt-6 mb-4">
                        <div class="bg-indigo-100 text-indigo-600 font-bold rounded-full w-8 h-8 flex items-center justify-center mr-3">5</div>
                        <h3 class="text-xl font-semibold text-gray-800">验证插件安装</h3>
                    </div>
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670051301226-aaed0e69-7fb8-42b9-812d-2ca7d2cb6c62.png" alt="验证插件示例" class="rounded-lg border border-gray-200">
                </div>
            </div>
        </section>

        <!-- Implementation Section -->
        <section id="implementation" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 p-3 rounded-full mr-4">
                    <i class="fas fa-code text-indigo-600 text-xl"></i>
                </div>
                <h2 class="text-3xl font-bold text-gray-800">代码实现</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- Configuration -->
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-cog text-indigo-500 mr-2"></i> 配置交换机、队列和路由键
                    </h3>
                    <div class="code-block p-4">
                        <pre class="text-sm"><code>@Configuration
public class DelayedConfig {

    public static final String YOUR_EXCHANGE_NAME = "delayed-exchange";
    public static final String YOUR_QUEUE_NAME = "delayed-queue";
    public static final String YOUR_ROUTING_KEY = "delayed-key";

    @Bean // 创建了一个交换机
    public CustomExchange delayedExchange() {
        Map&lt;String, Object&gt; args = new HashMap&lt;&gt;();
        args.put("x-delayed-type", "direct");
        CustomExchange customExchange = new CustomExchange(YOUR_EXCHANGE_NAME, "x-delayed-message",
                true, false, args);
        return customExchange;
    }

    @Bean
    public Queue delayedQueue() {
        return new Queue(YOUR_QUEUE_NAME);
    }

    @Bean
    public Binding delayedBinding() {
        return BindingBuilder.bind(delayedQueue()).to(delayedExchange()).with(YOUR_ROUTING_KEY).noargs();
    }
}</code></pre>
                    </div>
                </div>
                
                <!-- Sending Messages -->
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-paper-plane text-indigo-500 mr-2"></i> 发送延时消息
                    </h3>
                    <div class="code-block p-4">
                        <pre class="text-sm"><code>@GetMapping("/test")
public String test(String msg, Long time) {
    System.out.println("发送数据1:" + msg + ",时间:" + new Date());
    rabbitTemplate.convertAndSend(DelayedConfig.YOUR_EXCHANGE_NAME, 
        DelayedConfig.YOUR_ROUTING_KEY, msg, message -> {
            message.getMessageProperties().setHeader("x-delay", time);
            return message;
        });
    return "test";
}</code></pre>
                    </div>
                </div>
                
                <!-- Listening -->
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-headphones text-indigo-500 mr-2"></i> 监听延时队列
                    </h3>
                    <div class="code-block p-4">
                        <pre class="text-sm"><code>@RabbitListener(queues = DelayedConfig.YOUR_QUEUE_NAME)
public void listener(String msg, Channel channel, Message message) throws Exception {
    System.out.println("消费数据:" + msg + ",时间:" + new Date());
    channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}</code></pre>
                    </div>
                </div>
                
                <!-- Plugin Mode -->
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-puzzle-piece text-indigo-500 mr-2"></i> 插件模式原理
                    </h3>
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670053424917-d19fec92-f9f7-4f96-9e1a-5052d22edfc0.png" alt="插件模式示意图" class="rounded-lg border border-gray-200 mb-4">
                    <p class="text-gray-700">
                        插件模式下每个消息都是到期就被消费，并没有像TTL模式那样，还需要等待前一个消息到期，其实原因很简单，因为之前的模式，都是将消息存储到队列queue中，而延迟插件是将消息存储在交换机（exchange）中。
                    </p>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col items-center">
                <div class="mb-4">
                    <a href="http://www.yuque.com/jtostring" class="text-white hover:text-indigo-300 transition duration-300">
                        <span class="font-medium">技术小馆</span>
                    </a>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-400 hover:text-white transition duration-300 text-sm">
                        http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'dark'
        });
    </script>
</body>
</html>
```